package top.yudoge.dogeeditor.llm.util

class PromptUtils {

    companion object {
        fun loadPrompt(path: String, model: Map<String, String>): String {
            var stream = PromptUtils::class.java.getResourceAsStream(path) ?: return ""
            var template = stream.bufferedReader().use {
                it.readText()
            }

            model.forEach { (key, value) ->
                template = template.replace("\${$key}", value)
            }
            return template
        }
    }
}